#include "fdt_daemon.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

static void fd_handler(int fd, void* data)
{
    // recvfrom(fd ...
}

int main()
{
    struct fdt_fdesc fdesc;
    struct fdt_daemon dm;

    fdt_daemon_init(&dm);

    int fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
    //... more setup ops

    fdt_set_fddata(&fdesc, fd, fd_handler, NULL);
    fdt_daemon_add_fdesc(&dm, &fdesc); 

    fdt_daemon_start(&dm);

    return 0;
}
